package day13;

public abstract class Pet {
    protected String name;
    protected int health;
    protected int love;

    public Pet() {

    }

    public Pet(String name, int health, int love) {
        this.name = name;
        this.health = health;
        this.love = love;
    }

    public void show(){
        System.out.println("宠物名字："+this.name);
        System.out.println("宠物健康证："+this.health);
        System.out.println("宠物的喜爱度："+this.love);
    }

    /**
     * 1.抽象方法，没有方法体
     * 2.抽象方法，必须在抽象类中
     * 3.子类必须重写父类的抽象方法,或者子类把抽象方法转到下一级子类
     */
    public  abstract void eat();

    public void toHospital(){
        System.out.println("宠物去医院");
    }

}
